package com.flurry.android;

import com.flurry.org.apache.http.entity.mime.HttpMultipartMode;
import com.flurry.org.apache.http.entity.mime.MultipartEntity;
import com.flurry.org.apache.http.entity.mime.content.FileBody;
import com.flurry.org.apache.http.entity.mime.content.StringBody;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;

final class ap extends a
{
  public ap()
    throws Exception
  {
  }

  private JSONObject a(HashMap<String, Object>[] paramArrayOfHashMap)
  {
    try
    {
      this.c = ((AppCloudResponseHandler)paramArrayOfHashMap[0].get("del"));
      this.d = ((AppCloudResponseRequestManagerHandler)paramArrayOfHashMap[0].get("del_internal"));
      this.e = paramArrayOfHashMap[0];
      HttpPost localHttpPost = new HttpPost("https://" + FlurryAppCloud.I() + "/" + (String)paramArrayOfHashMap[0].get("url"));
      a(localHttpPost, paramArrayOfHashMap[0]);
      localHttpPost.setEntity(c((List)paramArrayOfHashMap[0].get("data")));
      JSONObject localJSONObject = new JSONObject(EntityUtils.toString(this.a.execute(this.b, localHttpPost, new BasicHttpContext()).getEntity()).toString());
      return localJSONObject;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return null;
  }

  private static MultipartEntity c(List<NameValuePair> paramList)
    throws Exception
  {
    MultipartEntity localMultipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
    int i = 0;
    if (i < paramList.size())
    {
      if (((NameValuePair)paramList.get(i)).getName().equals("file"))
      {
        String[] arrayOfString = ((NameValuePair)paramList.get(i)).getValue().split("/");
        String str2 = arrayOfString[(-1 + arrayOfString.length)];
        localMultipartEntity.addPart("file", new FileBody(new File(((NameValuePair)paramList.get(i)).getValue()), str2, "application/octet-stream", "utf-8"));
      }
      while (true)
      {
        i++;
        break;
        String str1 = ((NameValuePair)paramList.get(i)).getName();
        if ((str1 != "filename") && (str1 != "file"))
          localMultipartEntity.addPart(str1, new StringBody(((NameValuePair)paramList.get(i)).getValue()));
      }
    }
    return localMultipartEntity;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.ap
 * JD-Core Version:    0.6.2
 */